The Linux console is a system console internal to the Linux kernel. A system console is the device which receives all kernel messages and warnings and which allows logins in single user mode. The Linux console provides a way for the kernel and other processes to send text output to the user, and to receive text input from the user. The user typically enters text with a computer keyboard and reads the output text on a computer monitor. The Linux kernel supports – consoles that are logically separate, but which access the same physical keyboard and display. The Linux console (and Linux virtual consoles) are implemented by the VT (virtual terminal) subsystem of the Linux kernel, and do not rely on any user space software. This is in contrast to a terminal emulator, which is a user space process that emulates a terminal, and is typically used in a graphical display environment.
The Linux console was one of the first features of the kernel and was originally written by Linus Torvalds in 1991 (see history of Linux). There are two main implementations: framebuffer and text mode. The framebuffer implementation is the default in modern Linux distributions, and together with kernel mode setting, provides kernel-level support for display hardware and features such as showing graphics while the system is booting. The legacy text mode implementation was used in PC-compatible systems with CGA, EGA, MDA and VGA graphics cards. Non-x86 architectures used framebuffer mode because their graphics cards did not implement text mode. The Linux console uses fixed-size bitmap fonts, , usually defaulting to 8x16 pixels per character.
The Linux console is an optional kernel feature, and most embedded Linux systems do not enable it. These systems typically provide an alternative user interface (e.g. web based), or boot immediately into a graphical user interface and use this as the primary means of interacting with the user. Other implementations of the Linux console include the Braille console to support refreshable Braille displays and the serial port console.
During kernel boot, the console is commonly used to display the boot log of the kernel. The boot log includes information about detected hardware, and updates on the status of the boot procedure. At this point in time, the kernel is the only software running, and hence logging via user-space (e.g. syslog) is not possible, so the console provides a convenient place to output this information. Once the kernel has finished booting, it runs the init process (also sending output to the console), which handles booting of the rest of the system including starting any background daemons.
After the init boot process is complete, the console will be used to multiplexing multiple (accessible by pressing Ctrl-Alt-F1, Ctrl-Alt-F2 etc., Ctrl-Alt-LeftArrow, Ctrl-Alt-RightArrow, or using chvt). On each virtual terminal, a getty process is run, which in turn runs /bin/login to authenticate a user. After authentication, a command shell will be run. Virtual terminals, like the console, are supported at the Linux kernel level.
The Linux console implements a terminal type of "linux" and the escape sequences it uses are in the console_codes man page.
Each virtual console can have its own character set and keyboard layout. Linux 2.6 introduced the ability to load a different font for each virtual console (kernel versions predating 2.6 change the font only on demand).
The Linux kernel ( driver) has almost complete support for keyboard input (), but it remains a bit inconsistent because it interacts badly with different character sets. Layouts are loaded by the utility.
These two utilities and corresponding data files are packed in Linux Console Tools
shipped with many Linux distributions.
Efforts on the internationalization of Linux at the kernel level started as early as in 1994 by Markus Kuhn and Andries Brouwer.
Currently, there is no support for different modes on different virtual consoles.
| VGA text attributes | |||
| Custom fonts | |||
| Character set | 512 glyphs max. (on VGA text), any code page or UTF-8 | 223 or 256 characters (depends on access method), any code page, or Unicode | |
| Run-time character set switching | |||
| Terminal emulation | , ANSI-compatible (terminfo=linux) | , since Windows 10 "Threshold 2" | , ANSI (with ANSI.SYS) |
| Run-time switching between text mode and GUI | |||
| Run-time changing numbers of rows and columns | |||
| Switching between applications | (some terminate-and-stay-resident programs may be activated) | ||
| Non-standard modes | |||
| computer mouse support | (with gpm or similar) | ||
A Linux framebuffer console differs from a VGA one only in ways of drawing characters. The processing of keyboard events and virtual consoles’ support are exactly the same.
| Bell sound |
| Backspace |
| Horizontal tab |
| Line feed |
| Vertical tab |
| Form feed |
| Carriage return |
| Shift out |
| Shift in |
| Cancel escape sequence |
| Cancel escape sequence |
| Escape / begin escape sequence |
| Nothing |
| Start command sequence |
| Reverse line feed |
| Line feed |
| Carriage return and line feed |
| Set tab stop |
| Store cursor |
| Restore cursor |
| Switch keypad to numeric mode |
| Switch keypad to application mode |
| Reset terminal settings |
| Print terminal ID |
For ^[ press the Escape key.
The console also supports extended escape sequences, ANSI CSI Mode sequences, and DEC Private Mode sequences. These extended sequences can control colors, visual effects like blinking, underline, intensity and inverse video, bell tone frequency and duration, VESA screen blanking interval. Aside from the textual blanking, there is no known way to place the VGA adapter into standby.
| /dev/tty0 | c 4 | 0 | "current console" |
| /dev/tty1 ... /dev/tty63 | character device 4 | 1 ... 63 | virtual consoles (keyboard controlled) |
| /dev/ttyS0 ... | c 4 | 64 ... | , suitable for system console |
| /dev/vcs | c 7 | 0 | Virtual Console Screen /dev/vcs is the contents of the current virtual screen. |
| /dev/vcs1 ... /dev/vcs63 | c 7 | 1 ... 63 | The text (the character pointer table) of a virtual screen. |
| /dev/vcsa1 ... /dev/vcsa63 | c 7 | 129 ... 191 | Virtual Console Screen with Attributes Full image of a virtual text buffer; first 4 bytes contain numbers of rows, columns and cursor position |
|
|